import Home from '@/views/Home'

export const routes = [
  {
    path: '/',
    redirect: '/about',
    component: () => {
      console.log('加载home之前')
      return import(/* webpackChunkName: "index-module" */ '../views/Home.vue')
    },
    children: [
      {
        path: '/about',
        name: 'About',
        component: () => {
          console.log('执行到进入About之前===')
          return import(/* webpackChunkName: "about-module" */ '../views/About.vue')
        },
        redirect: { name: 'about.baseinfo' },
        children: [
          {
            path: '/about/baseinfo',
            name: 'about.baseinfo',
            component: () => {
              console.log('加载模块baseinfo 之前')
              return import(/* webpackChunkName: "baseinfo-module" */ '../views/baseinfo.vue')
            },
          },
        ],
      },
    ],
  },
  {
    path: '/tree',
    name: 'tree',
    component: () => {
      console.log('---执行到加载tree-module之前---')
      return import(/* webpackChunkName: "tree-module" */ '../views/tree.vue')
    },
  },
]
